The invention relates to a method and apparatus for accessing a logical block on a tape storage medium.
Today many devices like tape streamers do not support any means of fast access to logical blocks of positions on the tape. The reason is that the tape format does not contain any direct logical block count information. A logical block on those formats are only detected by special start or end information that does not contain a number or count. A positioning to any logical position is therefore only possible by reading all blocks from the start to the end while counting logical blocks. This method is extremely time consuming. For a standard QIC 525 cartridge in reverse direction, a worst case time will be many hours.
The QIC 525 is a well known type of standardized tape which is used in a tape drive known as a "tape streamer". QIC stands for "quarter inch cartridge" and "525" stands for the tape storage--namely 525 megabytes. Typically such tapes have 26 tracks.
Such tapes together with the tape streamer has as their main function the back-up of hard disk drives for archival storage. They are also useful for various types of software distribution and in some cases replace floppy disks.
Such tapes typically have a plurality of physical blocks located thereon, most of which contain data. Logical blocks corresponding to the data from the host computer may correspond to less than one physical block, or a plurality of physical blocks may be used for a single logical block.
The logical blocks are grouped or categorized under what are known as files separated with filemarks, and the files may be grouped or categorized under what are known as sets separated with setmarks.
A typical logical data block might, for example, be 1000 bytes whereas a typical physical data block might be 1024 bytes.
Other types of standardized back-up tapes used in tape streamers are known as the QIC 120 or the QIC 150 (120 or 150 megabytes, respectively). Those formats support only fixed blocks, but some vendors for those formats also provide logical blocks of variable size.
The QIC format tapes (QIC 120/150/525) may also contain what are known as either control blocks or filler blocks, such as in a trailer field at the end of the tape. Such tapes are also typically appended with data when additional data is to be added.
To enable a host system to position on a media such as a tape medium without having to read data, so called Space and Locate commands are known. Space commands are used to position the tape logically forward or reverse a certain number of blocks, filemarks or setmarks relative to a present logical position. The Locate command is used to position the tape to an absolute logical block address counting from Beginning Of Media (BOM). The difference between these commands from a drive point of view is how blocks should be counted, and if tape should be moved in a logical forward or reverse direction. Normal space foward and normal space reverse will now be described hereafter.
Normal space forward is done by skipping one datablock or tapemark block at a time while decrementing a desired count value until all blocks or tapemarks are found, or until a stop condition is detected. A stop condition may arise when a tapemark is detected while spacing blocks, a setmark is found while spacing filemarks, a bad block is found, or an error condition is detected. When skipping blocks or tapemarks, the logical block and tapemark counters will be updated.
Normal space reverse is more difficult to execute than normal space forward. The reason is that the drive is not able to read in reverse direction. The drive will therefore have to position the tape so that it can read data to fill the buffer with data logical in front of the present position. It will then have to test the buffer in reverse order until the end condition is met, or until the front of the buffer is met. If the front is met (buffer empty situation) the drive will have to calculate the address of the first block in the next buffer logical in front of the last, and start reading those blocks. The sequence will repeat until the stop condition is met. Each time a new buffer is read, the tape will have to stop and move logical reverse to position in front of the first block in the previous buffer, and then start logical forward again to read the blocks. This means a lot of start stop operation is necessary and very low performance results.